VLAN : Virtual Local Area Network management

更新时间:
2024-05-15
下载文档

VLAN : Virtual Local Area Network management

This module provides VLAN (Virtual Local Area Network) management. This module supports the IEEE 802.1Q standard, and can set a VLAN tag on any ethernet network interface of this machine.

User can use the following code to import the vlan module.

var vlan = require('router/vlan');

Support

The following shows vlan module APIs available for each permissions.

 User ModePrivilege Mode
vlan.set 
vlan.get 

VLAN Object

vlan.set(ifname, tag[, prio])

  • ifname {String} Network interface name.
  • tag {Integer} VLAN id (0 ~ 4094), 0: Cancel VLAN settings.
  • prio {Integer} VLAN priority (0 ~ 7) default: 0.
  • Returns: {Boolean} Whether the setup was successful.

Set the VLAN tag and priority of the specified network interface.

Example

vlan.set('en1', 1024);

vlan.get(ifname)

  • ifname {String} Network interface name.
  • Returns: {Object} VLAN setting.

Gets the VLAN setting information of the specified network interface. The returned object contains the following attributes:

  • tag {Integer} VLAN id, 0: means no VLAN tag.
  • prio {Integer} VLAN priority.
文档内容是否对您有所帮助?
有帮助
没帮助